package com.hnqcgczy.sgzShop.service.impl;

import com.hnqcgczy.sgzShop.dao.IProductDao;
import com.hnqcgczy.sgzShop.service.IProductService;
import com.hnqcgczy.sgzShop.vo.TProduct;

import java.sql.SQLException;
import java.util.List;

public class ProductServiceImpl implements IProductService {
    private IProductDao productDao;

    public ProductServiceImpl(IProductDao productDao) {
        this.productDao = productDao;
    }

    @Override
    public List<TProduct> listAllProduct() throws SQLException {
        List<TProduct> list = productDao.listAllProduct();

        return list;
    }

    @Override
    public List<TProduct> queryAnyProduct(TProduct tProduct, int page, int pageSize) throws SQLException {
        List<TProduct> list = productDao.queryAnyProduct(tProduct, page, pageSize);
        return list;
    }

    @Override
    public TProduct querById(int tp_id) throws SQLException {
        TProduct tProduct = productDao.querById(tp_id);
        return tProduct;
    }
}
